<?php

 
 Zend_Loader::loadClass("BaseDBRows");
 Zend_Loader::loadClass("UserGroup");
 class UserGroups extends BaseDBRows
 {
 	protected function setUp()
 	{
 		$this->_tableName = UserGroup::_tablename;
 	}	
	
	public function getUserGroupsArray()
	{
		$query = new QueryCreator();
		$query->addFrom($this->_tableName);
		
		$query->addSelect("id, user_group_code, name, created_by, date_created");
		$query->addOrderBy("date_created DESC");
		
		$db = DBCon::instance();
		$result = $db->executeQuery($query->createSQL());
		
		/* 
			author: Michael Ocana
			description : remove for .tpl use dont have id in checkbox
						  add id column in usergroup table
			date : feb-07-2010
		*/
		#$result = $db->query($query->createSQL());	
		//$data = array();
		//if ($result) {
		//	while ($row = $result->fetch(Zend_Db::FETCH_OBJ)) {
		//		$data[$row->user_group_code] = $row->name;
		//	}
		//}
		return $result;
	}
	
 }
?>